<!DOCTYPE html>
<html>
<head>
    <title>${sysEn}-文件列表</title>
     <#include "/common/com_css.ftl" >
</head>
<body>
    <div id="wrapper">
        <!----左侧导航开始----->
        <#include "/common/menu.ftl">
        <!----左侧导航结束----->

        <!---右侧内容区开始---->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <#include "/common/con_nav.ftl">
            <@con_nav_tag current="文件"></@con_nav_tag>
            <!-- 检索条件开始 -->
            <div class="ibox-content m-b-sm border-bottom">
                <div class="row">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" for="typeId">类型</label>
                            <select class="form-control m-b" name="typeId" id="typeId">
                                <option value="">不限</option>
                                <#list typeList as p>
 									<option value=${p.id}>${p.name}</option>						
								</#list>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group">
                            <label class="col-form-label" for="name">名称</label>
                            <input type="text" id="name" name="name" value="" placeholder="" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="text-left">
                    <input type="button" name="" class="btn btn-primary" value="提交" id="btnSubmit"></input>
                </div>
            </div>
            <!-- 检索条件结束 -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox ">
                        <div class="ibox-content">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="example" >
                                </table>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <#include "/common/footer.ftl">
        </div>
        <!---右侧内容区结束---->
     </div>
    <#include "/common/com_table_js.ftl">
    <script>
        $(document).ready(function() {
            var table =  ListPageManager.DataTable.init({
                ajax:{
                    url:"${ctx}/cms_media_list_page.do"
                },
                ajaxParam:function(){
                    var obj = {};
                    if($("#typeId").val()) {
                        obj["typeId"] = $("#typeId").val();
                    }
                    if($("#name").val()) {
                        obj["name"] = $("#name").val();
                    }
                    return obj;
                },
                buttons:[{cmd:'add'}],
                addUrl:function(){return "${ctx}/cms_media_edit.do"},
                deleteUrl:function(row,data,dataIndex){return "${ctx}/cms_media_del.do?ids[]=" + data.id},
                rowCreatedCall:function(row,data,dataIndex){},
                withCheckColumn:{flg:false,key:"id"},
                columns:[
                    {title:"序号",data:"id"},
                    {title:"名称",data:"name"},
       				{title:"备注",data:"remarks"},
                    {title:"类型",data:"typeFmt"},
		            {title:"地址",data:"relativePath"},
                  
                    {title:"",toolcolinfo:[{"cmd":"status",gettext:function(data,type,row){
                               return "查看";
                            },click:function(cmd,row,data,dataIndex){
								window.open(data.relativePath);     
                            }},{"cmd":"del"}]}
                ]
            },$("#example"));
            $("#btnSubmit").on("click",function(){
                table.redraw();
            });
        });
    </script>
</body>
</html>
